package problem.solution.case01;

import org.springframework.aop.support.AopUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ControllerSolution01 {

    @Resource
    ASolution01 aSolution01;

    /**
     * 解决方案1：在注入的类中,注入对象本身
     */
    @RequestMapping(value = "/solution01",method = RequestMethod.GET)
    public void proxyClassTest(){
        boolean aopProxy1 = AopUtils.isAopProxy(aSolution01);
        System.out.println("proxyClassTest result = " + aopProxy1);
        aSolution01.save01();
    }
}
